package com.kmproject.haifu.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.http.imageloader.glide.ImageConfigImpl;
import com.jess.arms.utils.ArmsUtils;
import com.kmproject.haifu.R;
import com.kmproject.haifu.mvp.model.entity.beans.HousePayWayBean;

import java.util.List;

public class HousePublishSelectTypeItemAdapter extends BaseQuickAdapter<HousePayWayBean, BaseViewHolder> {
    ImageLoader glideImage;
    public HousePublishSelectTypeItemAdapter(@Nullable List<HousePayWayBean> data) {
        super(R.layout.housepublish_select_type_item_item,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HousePayWayBean item) {
        if (glideImage == null) {
            glideImage = ArmsUtils.obtainAppComponentFromContext(mContext).imageLoader();
        }
        glideImage.loadImage(mContext, ImageConfigImpl.builder().url(item.getIcon())
                .imageView(helper.<ImageView>getView(R.id.housepublish_select_type_item_item_img))
                .build());
         helper.<TextView>getView(R.id.housepublish_select_type_item_item_name).setText(item.getName());
        helper.<TextView>getView(R.id.housepublish_select_type_item_item_descript).setText(item.getDescription());

    }
}
